Communication Apparatus

ABSTRACT

A communication apparatus may cause a display to display a first inquiry message in a case where an apparatus search signal is received from an external apparatus, the apparatus search signal being for searching a target apparatus which is to establish a wireless connection with the external apparatus, and the first inquiry message being for inquiring a user whether a particular wireless connection is to be established between the communication apparatus and the external apparatus. The communication apparatus may establish the particular wireless connection between the communication apparatus and the external apparatus in a case where it is selected by the user, in response to the first inquiry message, that the particular wireless connection is to be established.

CROSS-REFERENCE TO RELATED APPLICATION

This application claims priority to Japanese Patent Application No.2014-178065, filed on Sep. 2, 2014, the contents of which are herebyincorporated by reference into the present application.

TECHNICAL FIELD

The present application discloses a communication apparatus capable ofestablishing a wireless connection with an external apparatus.

DESCRIPTION OF RELATED ART

Techniques for establishing a wireless connection between a firstapparatus and a second apparatus according to a WFD (an abbreviation ofWi-Fi Direct) scheme are known. For instance, the first apparatus sendsa Probe Request signal and receives, from each of one or moreapparatuses including the second apparatus, a Probe Response signalincluding a device name or an SSID (an abbreviation of Service SetIdentifier) of the apparatus. The first apparatus displays on a displayunit of the first apparatus a list including one or more device names orSSIDs of one or more apparatuses. When a user selects information of thesecond apparatus from the list, a wireless connection is establishedbetween the first apparatus and the second apparatus.

SUMMARY

In the technique described above, when the list including one or moredevice names or SSIDs of one or more apparatuses is displayed on thedisplay unit of the first apparatus, the user has to select theinformation on the second apparatus that is a target which is toestablish a wireless connection with the first apparatus. However, forinstance, for a user who lacks knowledge about wireless communication,it is difficult to appropriately select the information of the secondapparatus from the list. Namely, for the user, it is difficult toestablish a wireless connection between a pair of apparatuses (in otherwords, the first apparatus and the second apparatus). The presentapplication provides a technique enabling a user to establish easily awireless connection between an objective pair of apparatuses.

One aspect disclosed in the present specification may be a communicationapparatus comprising: a display; a processor; and a memory storingcomputer-readable instructions therein, the computer-readableinstructions, when executed by the processor, causing the communicationapparatus to perform: causing the display to display a first inquirymessage in a case where an apparatus search signal is received from anexternal apparatus, the apparatus search signal being for searching atarget apparatus which is to establish a wireless connection with theexternal apparatus, and the first inquiry message being for inquiring auser whether a particular wireless connection is to be establishedbetween the communication apparatus and the external apparatus; andestablishing the particular wireless connection between thecommunication apparatus and the external apparatus in a case where it isselected by the user, in response to the first inquiry message, that theparticular wireless connection is to be established.

Moreover, a control method, a computer program, and a computer-readablerecording medium that stores the computer program, all for realizing thecommunication apparatus, are also novel and useful. Further, acommunication system comprising the communication apparatus and theexternal apparatus is also novel and useful.

BRIEF DESCRIPTION OF DRAWINGS

FIG. 1 illustrates a configuration of a communication system;

FIG. 2 illustrates a flow chart of a process performed by a printer;

FIG. 3 illustrates a flow chart of a first monitoring process;

FIG. 4 illustrates a flow chart following the first monitoring process;

FIG. 5 illustrates a flow chart of a second monitoring process;

FIG. 6 illustrates a sequence diagram of a case A where the printer isin a G/O state;

FIG. 7 illustrates a sequence diagram of a case B where the printer isin a device state;

FIG. 8 illustrates a sequence diagram of a case C where the printer isin the G/O state;

FIG. 9 illustrates a sequence diagram of a case D where the printer isin the device state;

FIG. 10 illustrates a flow chart of a first monitoring process of asecond embodiment;

FIG. 11 illustrates a sequence diagram in a case E where the printer inthe G/O state stores Persistent information; and

FIG. 12 illustrates a sequence diagram in a case F where the printer inthe device state stores the Persistent information.

EMBODIMENTS First Embodiment Configuration of Communication System 2FIG. 1

A communication system 2 comprises a printer PR and a terminal apparatusTA. Between the printer PR and the terminal apparatus TA can establish awireless connection (hereinafter referred to as “connection”), and canexecute wireless communication using the connection each other.

(Configuration of Printer PR)

The printer PR is a peripheral apparatus (namely, a peripheral apparatusof a terminal apparatus TA and such) capable of performing a printingfunction, and has a device name “AAA”. The printer PR comprises: anoperation unit 12; a display unit 14; a print performing unit 16; awireless interface 20; and a controller 30. Hereinafter an interface isdenoted as “I/F”.

The operation unit 12 is constituted of a plurality of keys. A user mayinput various instructions into the printer PR by operating theoperation unit 12. The display unit 14 is a display for displayingvarious kinds of information. The unit 14 also functions as a touchpanel. The print performing unit 16 is a printing mechanism of an inkjet type, a laser type, and such.

A MAC address “aaa” is pre-allocated to the wireless network I/F 20. Thewireless network I/F 20 is an interface for executing wirelesscommunication (namely, WFD communication) according to the WFD schemeformulated by the Wi-Fi Alliance. The WFD scheme is a wirelesscommunication system described in specifications “Wi-Fi Peer-to-Peer(P2P) Technical Specification Version1.1” prepared by the Wi-FiAlliance. The details of the WFD scheme are also disclosed in U.S.Patent Application Publication No. 2013/0260683, and the document isquoted by referring. The controller 30 may perform the WFD communicationthrough the wireless network I/F 20.

The controller 30 comprises: a CPU 32 and a memory 34. The CPU 32 is aprocessor that performs various processes according to a program 36stored in the memory 34. The memory 34 is constituted of RAM, ROM, andsuch.

The printer PR is capable of operating in any one of states of a GroupOwner state, a Client state, and a device state of the WFD scheme.Hereinafter the Group Owner state and the Client state are denoted as“G/O state” and “CL state”, respectively. When the printer PR operatesin the G/O state, the printer PR forms a WFD network (hereinafterreferred to as “WFDNW”), establishes a connection with one or moreexternal apparatuses (for instance, the terminal apparatus TA), and mayallow the one or more external apparatuses to participate in the WFDNW.For instance, when an external apparatus is an apparatus that supportsthe WFD scheme (hereinafter referred to as “WFD apparatus”), theexternal apparatus operates in the CL state and participates in theWFDNW. For instance, when an external apparatus does not support the WFDscheme, namely, when the external apparatus is a legacy apparatus, theexternal apparatus participates in the WFDNW without operating in anystate of the WFD scheme. Namely, the external apparatus participates inthe WFDNW as a station. In a state where the printer PR operates in theG/O state, an upper limit number of connections that the printer PR maysimultaneously establish is predetermined. Although, in the presentembodiment, the upper limit number is “2”, it may be some other value(for instance, “1”, or equal to or more than “3”). When the printer PRoperates in the CL state, the printer PR can establish a connection withan external apparatus operating in the G/O state, and can participate inthe WFDNW formed by the external apparatus. The device state is neitherthe G/O state nor the CL state, namely, it is a state where the printerPR does not establish a connection with an external apparatus.

(Configuration of Terminal Apparatus TA)

The terminal apparatus TA, may be, for example, a portable apparatussuch as a mobile phone, a smart phone, a notebook PC, and a tablet PC,and may be a stationary apparatus such as a desktop PC and a television.The terminal apparatus TA has a device name “BBB”. A MAC address “bbb”is allocated to a wireless network I/F (an illustration is omitted) ofthe terminal apparatus TA. The terminal apparatus TA may be a WFDapparatus or a legacy apparatus.

Process of Printer PR FIG. 2

Next, with reference to FIG. 2, content of a process performed by theCPU 32 of the printer PR is described. The process is performed with apower supply of the printer PR being turned ON as a trigger.

In S2, the CPU 32 monitors that a Probe Request signal is received fromthe terminal apparatus TA through the wireless network I/F 20. The ProbeRequest signal is a signal sent from the terminal apparatus TA when, inthe terminal apparatus TA, a search operation is performed by a user tosearch an apparatus, which is to establish connection with the terminalapparatus TA. When the terminal apparatus TA is a WFD apparatus, theProbe Request signal includes WFD information indicating that theterminal apparatus TA supports the WFD scheme and the device name “BBB”of the terminal apparatus TA. On the other hand, when the terminalapparatus TA is a legacy apparatus, the Probe Request signal includesthe device name “BBB” but does not include the WFD information. Whenreceiving the Probe Request signal from the terminal apparatus TA (YESin S2), the CPU 32 proceeds to S4. When the Probe Request signal isreceived, the printer PR is either a G/O apparatus operating in the G/Ostate or a device apparatus operating in the device state. Namely, theprinter PR, in a case of being a CL apparatus operating in the CL state,does not receive the Probe Request signal from the terminal apparatusTA. Hereinafter a Request is denoted as “Req.” Since all communicationsperformed by the printer PR is performed via the wireless network I/F20, the description “via the wireless network I/F 20” is omitted.

In S4, the CPU 32 sends the Probe Response signal to the terminalapparatus TA. In a case where the printer PR is a G/O apparatus, in thememory 34, a password, an SSID “XXX”, an authentication method, anencryption method, and such (hereinafter referred to as “password andsuch”) currently being used in the WFDNW formed by the printer PR arestored. In a case where the printer PR is a G/O apparatus, the ProbeResponse signal includes the SSID “XXX” for distinguishing the WFDNW inthe memory 34. On the other hand, in a case where the printer PR is adevice apparatus, the Probe Response signal includes the device name“AAA” of the printer PR. Hereinafter a Response is referred to as“Res.”.

In S6, the CPU 32 determines whether the number of wireless connectionscurrently established by the printer PR (hereinafter referred to as “thenumber of connections”) is less than “2”, which is the upper limitnumber. In a case where the printer PR is a G/O apparatus and the numberof connections is less than the upper limit number, the CPU 32determines YES in S6 and proceeds to S10. In a case where the printer PRis a device apparatus, namely, in a case where the number of connectionsis “0”, the CPU 32 determines YES in S6, and proceeds to S10. On theother hand, in a case where the printer PR is a G/O apparatus and thenumber of connections is the upper limit number, the CPU 32 determinesNO in S6, and returns to S2 without performing processes of S10 onward.

In S10, the CPU 32 determines whether the Probe Req. signal received inS2 includes the WFD information. In a case where determining that theProbe Req. signal includes the WFD information (YES in S10), the CPU 32proceeds to S14. On the other hand, in a case of determining that theProbe Req. signal does not include the WFD information (NO in S10),proceeds to S20, the CPU 32 performs a second monitoring process (referto FIG. 5). The CPU 32 returns to S2 after finishing S20.

In S14, the CPU 32 determines whether field intensity of a carrier waveused in communication of the Probe Req. signal received in S2 is equalto or more than a threshold Th. In a case of determining that the fieldintensity is equal to or more than threshold Th (YES in S14), the CPU 32proceeds to S16. On the other hand, in a case of determining that thefield intensity is less than the threshold Th (NO in S14), the CPU 32proceeds to S20.

In S16, the CPU 32 displays a first inquiry image 100 on the displayunit 14. The first inquiry image 100 includes: a message reporting auser that the terminal apparatus TA having the device name “BBB”included in the Probe Req. signal received in S2 is searching for atarget apparatus for connection; and a message inquiring the userwhether to establish a connection between the printer PR and theterminal apparatus TA. The first inquiry image 100 includes an OK button102 for selecting to establish a connection and a Cancel button 104 forselecting not to establish a connection.

Next, in S18, the CPU 32 performs a first monitoring process (refer toFIG. 3 and FIG. 4). The CPU 32 returns to S2 after finishing S18.

As described above, the printer PR, in a case where the Probe Req.signal includes the WFD information (YES in S10), namely, when theterminal apparatus TA is a WFD apparatus, displays the first inquiryimage 100. Although the details are described later, in a case where theOK button 102 in the first inquiry image 100 is selected, the InvitationReq. signal or a G/O Negotiation Req. signal is sent from the printer PRto the terminal apparatus TA (refer to S106 and S112 of FIG. 3). As aresult, the printer PR can appropriately establish a connection with theterminal apparatus TA, which is a WFD apparatus. On the other hand, theprinter PR, in a case where the Probe Req. signal does not include theWFD information (NO in S10), namely, the terminal apparatus TA is alegacy apparatus, does not display the first inquiry image 100. A legacyapparatus can not execute a process in response to the above InvitationReq. signal or the G/O Negotiation Req. signal. Supposing that theterminal apparatus TA is a legacy apparatus, when the first inquiryimage 100 is displayed, the user may possibly select the OK button 102in the first inquiry image 100. In this case, a signal (namely, theInvitation Req. signal or the G/O Negotiation Req. signal), to which theterminal apparatus TA which is a legacy apparatus can respond, is sentto the terminal apparatus TA. In the present embodiment, since the firstinquiry image 100 is not displayed, the sending of a signal to which theterminal apparatus TA which is a legacy apparatus can not respond, maybe suppressed to be sent.

The printer PR, in a case where the field intensity of the carrier waveused in the communication of the Probe Req. signal is equal to or morethan the threshold Th (YES in S14), displays the first inquiry image100, and in a case where the field intensity is less than the thresholdTh (NO in S14), does not display the first inquiry image 100. Forinstance, when a distance between the printer PR and the terminalapparatus TA is small, the field intensity becomes equal to or more thanthe threshold Th, and, when the distance between the printer PR and theterminal apparatus TA is large, the field intensity becomes less thanthe threshold Th. For instance, a user of the terminal apparatus TA, ina case of printing of an image represented by data in the terminalapparatus TA is to be performed, generally desires to use a printerexisting near the terminal apparatus TA. Considering such a demand, theprinter PR, in a situation where the terminal apparatus TA is existingnear the printer PR, namely, in a situation where the field intensity isequal to or more than the threshold Th, displays the first inquiry image100. Therefore, the user, by selecting the OK button 102 in the firstinquiry image 100, may establish a connection between the terminalapparatus TA and the printer PR near the terminal apparatus TA (refer toS116 and such of FIG. 3 described later), as a result, can allow theprinter PR to perform printing. On the other hand, the printer PR, in asituation where the terminal apparatus TA is not existing near theprinter PR, namely, in a situation where the field intensity is lessthan the threshold Th, does not display the first inquiry image 100.Therefore, for instance, it is possible to suppress a third party, whichis different from the user of the terminal apparatus TA, from mistakenlyselecting the OK button 102 in the first inquiry image 100 displayed onthe printer PR positioned away from the terminal apparatus TA. Namely,to establish a connection between the terminal apparatus TA and theprinter PR is suppressed even though the user of the terminal apparatusTA does not desire to use the printer PR.

First Monitoring Process FIG. 3

Next, with reference to FIG. 3, content of the first monitoring processexecuted in S18 of FIG. 2 is described. In S102, the CPU 32 monitorsthat operation is performed by the user in response to the first inquiryimage 100. In a case where the touch panel of the display unit 14 isoperated by the user and the OK button 102 is selected, the CPU 32proceeds to S104, and, in a case where the Cancel button 104 isselected, the CPU 32 finishes the first monitoring process. In a casewhere neither the OK button 102 nor the Cancel button 104 is selected bythe user, the CPU 32 proceeds to S202 of FIG. 4.

In S104, the CPU 32 determines whether the printer PR is a G/Oapparatus. In a case of determining that the printer PR is a G/Oapparatus (YES in S104), the CPU 32 proceeds to S106. On the other hand,in a case of determining that the printer PR is a device apparatus (NOin S104), the CPU 32 proceeds to S112.

In S106, the CPU 32 sends the Invitation Req. signal to the terminalapparatus TA. The Invitation Req. signal is a signal for inviting theterminal apparatus TA as a CL apparatus of the WFDNW formed by theprinter PR. In S108, the CPU 32 receives the Invitation Res. signal,which is a response signal of the Invitation Req. signal from theterminal apparatus TA.

Next, in S116, the CPU 32 executes a first connection sequence with theterminal apparatus TA, and executes a connection with the terminalapparatus TA. Specifically, the CPU 32 performs a WCS Exchange with theterminal apparatus TA. In S116 executed through S108, the printer PR isa G/O apparatus, and the password and such currently used in the WFDNWformed by the printer PR are stored in the memory 34. The CPU 32 sendsthe password and such in the memory 34 to the terminal apparatus TA inthe WCS Exchange. Next, the CPU 32 executes authentication by executinga 4-Way Handshake with the terminal apparatus TA. Because of this, theCPU 32 allows the terminal apparatus TA to participate as a CL apparatusin the WFDNW formed by the printer PR. When S116 is finished, the firstmonitoring process is finished.

On the other hand, in S112, the CPU 32 sends the G/O Negotiation Req.signal including an Intent value representing a G/O priority of theprinter PR, to the terminal apparatus TA. Next, in S114, the CPU 32receives the G/O Negotiation Res. signal including the Intent valuerepresenting the G/O priority of the terminal apparatus TA, from theterminal apparatus TA. The Intent value of the printer PR is an index toindicate a degree with which the printer PR is to be a G/O apparatus,and is predetermined in the printer PR. Similarly, the Intent value ofthe terminal apparatus TA is an index to indicate a degree with whichthe terminal apparatus TA is to be a G/O apparatus, and is predeterminedin the terminal apparatus TA. The CPU 32 compares the Intent value ofthe printer PR and the Intent value of the terminal apparatus TA,determines that an apparatus with a larger Intent value is to be a G/Oapparatus, and determines that an apparatus with a smaller Intent valueis to be a CL apparatus. Hereinafter Negotiation is denoted as “Nego.”.

In S115, the CPU 32 sends a G/O Nego. Confirmation signal to theterminal apparatus TA. The G/O Nego. Confirmation signal includesinformation regarding which of the printer PR and the terminal apparatusTA is to be a G/O apparatus. As described above, communication of theG/O Nego. Req. signal, the G/O Nego. Res. signal, and the G/O Nego.Confirmation signal is communication so-called G/O negotiation and isoperation-determining communication to determine as which of a G/Oapparatus and a CL apparatus the printer PR is to operate.

The CPU 32 shifts an operating state of the printer PR from the devicestate to the G/O state or the CL state according to a result of the G/Onegotiation. The terminal apparatus TA, in a case of receiving the G/ONego. Confirmation signal from the printer PR, shifts the operatingstate of the terminal apparatus TA from the device state to the CL stateor the G/O state according to information represented by the G/O Nego.Confirmation signal. In a case where the operating state of the printerPR is shifted to the G/O state, the CPU 32 forms the WFDNW in which theprinter PR operates as a G/O apparatus. In this case, the CPU 32generates a password and such to be used in the WFDNW, and stores thesekinds of information in the memory 34. On the other hand, in a casewhere the operating state of the printer PR is shifted to the CL state,the terminal apparatus TA forms the WFDNW in which the terminalapparatus TA operates as a G/O apparatus.

Next, in S116 performed through S115, the CPU 32 executes the firstconnection sequence according to the operating state of the printer PRwith the terminal apparatus TA, and establishes a connection with theterminal apparatus TA. A case where the printer PR is a G/O apparatus issimilar to S116 executed through S108. In a case where the printer PR isa CL apparatus, the CPU 32 receives, from the terminal apparatus TA inthe WCS Exchange, the password and such to be used in the WFDNW formedby the terminal apparatus TA. The CPU 32, then, executes theauthentication by executing the 4-Way Handshake with the terminalapparatus TA. Because of this, in a case where the printer PR is a CLapparatus, the CPU 32 allows the printer PR to participate as a CLapparatus in the WFDNW in which the terminal apparatus TA operates as aG/O apparatus. When S116 is finished, the first monitoring process isfinished.

Continuation of the First Monitoring Process FIG. 4

Next, with reference to FIG. 4, a process is described in a case wherethe OK button 102 or the Cancel button 104 is not selected in responseto the first inquiry image 100. In S202, the CPU 32 monitors that aProvision Discovery Req. signal is received from the terminal apparatusTA. The Provision Discovery Req. signal is a signal for confirming a WPS(an abbreviation of Wi-Fi Protected Setup) scheme (for instance, a pushbutton method, a PIN code method, and such). In a case where the printerPR is a G/O apparatus and the terminal apparatus TA is a WFD apparatus,the Provision Discovery Req. signal may be received in S202. In a casewhere the Provision Discovery Req. signal is received from the terminalapparatus TA (YES in S202), the CPU 32 proceeds to S204. On the otherhand, in a case where the Provision Discovery Req. signal is notreceived from the terminal apparatus TA (NO in S202), the CPU 32proceeds to S210.

The following is a situation where the Provision Discovery Req. signalis received from the terminal apparatus TA, which is a WFD apparatus.The printer PR, which is a G/O apparatus, received the Probe Req. signalfrom the terminal apparatus TA (YES in S2 of FIG. 2), and sent, to theterminal apparatus TA, the Probe Res. signal including the SSID “XXX” ofthe WFDNW formed by the printer PR (S4). In a case where one or moreapparatuses, which are G/O apparatuses or device apparatuses, other thanthe printer PR exist around the terminal apparatus TA, the terminalapparatus TA receives the Probe Res. signals including the device namesor the SSIDs of the one or more apparatuses from the one or moreapparatuses. The terminal apparatus TA displays the selection displayincluding the SSID “XXX”. The selection display may include the devicenames or the SSIDs of the one or more apparatuses. The terminalapparatus TA, in a case where the SSID “XXX” is selected by the user onthe selection display, sends the Provision Discovery Req. signal to theprinter PR. Thereby, the Provision Discovery Req. signal is receivedfrom the terminal apparatus TA.

In S204, the CPU 32 displays a second inquiry image 200 on the displayunit 14 in place of the first inquiry image 100 displayed in S16 of FIG.2. The second inquiry image 200 includes: a message for notifying a userthat a connection request has been received from the terminal apparatusTA having the device name “BBB”; and a message for inquiring with theuser about whether to establish a connection between the printer PR andthe terminal apparatus TA. The second inquiry image 200 includes an OKbutton 202 for selecting to establish a connection and a Cancel button204 for selecting not to establish a connection. In S206, the CPU 32specifies an operation performed by the user in response to the secondinquiry image 200. In a case where the touch panel of the display unit14 is operated by the user and the OK button 202 is selected, the CPU 32proceeds to S208, and, in a case where the Cancel button 204 isselected, finishes the first monitoring process. In the presentembodiment, although the CPU 32 displays the second inquiry image 200 inplace of the first inquiry image 100 on the display unit 14, the secondinquiry image 200 may be further displayed on the display unit 14 whilemaintaining a state where the first inquiry image 100 is displayed onthe display unit 14.

In S208, the CPU 32 executes the second connection sequence with theterminal apparatus TA, and establishes a connection with the terminalapparatus TA. Specifically, the CPU 32 sends the Provision DiscoveryRes. signal, which is a response signal to the Provision Discovery Req.signal, to the terminal apparatus TA. Next, the CPU 32 executes the WCSExchange and the 4-Way Handshake with the terminal apparatus TA. Sincethe printer PR is a G/O apparatus, the CPU 32 sends, to the terminalapparatus TA, in the WCS Exchange the password and such in the memory 34currently used in the WFDNW formed by the printer PR. Thereby, the CPU32 can allow the terminal apparatus TA to participate as a CL apparatusin the WFDNW in which the printer PR operates as a G/O apparatus. WhenS208 is finished, the first monitoring process is finished.

In S210, the CPU 32 monitors that the G/O Nego. Req. signal includingthe Intent value representing the G/O priority of the terminal apparatusTA is received from the terminal apparatus TA. In a case where theprinter PR is a device apparatus and the terminal apparatus TA is a WFDapparatus, the G/O Nego. Req. signal may be received in S210. In a casewhere the G/O Nego. Req. signal is received from the terminal apparatusTA (YES in S210), the CPU 32 proceeds to S212. In a case where neitherthe Provision Discovery Req. signal nor the G/O Nego. Req. signal isreceived from the terminal apparatus TA (NO in S210), the CPU 32 returnsto S102 of FIG. 3.

A situation where the G/O Nego. Req. signal is received from theterminal apparatus TA, which is a WFD apparatus, is as follows. Theprinter PR, which is a device apparatus, received the Probe Req. signalfrom the terminal apparatus TA (YES in S2 of FIG. 2), and sent the ProbeRes. signal including the device name “AAA” of the printer PR to theterminal apparatus TA (S4). Next, the terminal apparatus TA displays theselection display including the device name “AAA”. Similarly asdescribed in S204, the selection display may further include the devicenames or the SSIDs of the one or more apparatuses. The terminalapparatus TA, in a case where the device name “AAA” is selected by theuser in the selection display, sends the G/O Nego. Req. signal to theprinter PR. Thereby, the G/O Nego. Req. signal may be received from theterminal apparatus TA.

S212 and S214 are similar to S204 and S206. In S216, the CPU 32establishes a connection with the terminal apparatus TA by executing athird connection sequence with the terminal apparatus TA. Specifically,the CPU 32 sends the G/O Nego. Res. signal including the Intent valuerepresenting the G/O priority of the printer PR to the terminalapparatus TA. The CPU 32 receives, from the terminal apparatus TA, theG/O Nego. Confirmation signal including information indicating which ofthe printer PR and the terminal apparatus TA is to be a G/O apparatus.The CPU 32 shifts the operating state of the printer PR from the devicestate to the G/O state or the CL state according to a result of the G/Onegotiation. Each process thereafter according to the operating state ofthe printer PR is similar to each process described in S116 of FIG. 3.When S216 is finished, the first monitoring process is finished.

Second Monitoring Process FIG. 5

Next, with reference to FIG. 5, content of the second monitoring processexecuted in S20 of FIG. 2 is described. S232 to S246 are similar to S202to S216 of FIG. 4. However, in S234 and S242, the second inquiry image200 is not displayed in place of the first inquiry image 100, but thesecond inquiry image 200 is displayed in a state where the first inquiryimage 100 is not displayed.

In S248, the CPU 32 determines whether the Probe. Req. signal receivedin S2 of FIG. 2 does not include the WFD information and includes WPSinformation. The WPS information is information representing that anapparatus of a sender of the Probe. Req. signal is executing a processaccording to the WPS scheme. In case where the Probe. Req. signalincludes the WPS information, it is highly likely that the user desiresa connection is to be established between the apparatus of the sender ofthe Probe. Req. signal and an apparatus of a destination. When theprinter PR is a G/O apparatus or a device apparatus and the terminalapparatus TA is a legacy apparatus, the Probe. Req. signal received inS2 does not include the WFD information but includes the WPSinformation. In a case where the Probe. Req. signal received in S2 doesnot include the WFD information and includes the WPS information (YES inS248), the CPU 32 proceeds to S250. On the other hand, tin a case wherethe Probe. Req. signal received in S2 includes the WFD information, or,in a case where the Probe. Req. signal does not include the WPSinformation (NO in S248), the CPU 32 returns to S232.

S250 and S252 are similar to S234 and S236. In S256, the CPU 32establishes a connection with the terminal apparatus TA by executing thefirst connection sequence with the terminal apparatus TA. Specifically,in a case where the operating state of the printer PR is the devicestate, the CPU 32 shifts the operating state of the printer PR from thedevice state to the G/O state, and forms the WFDNW. In a case where theoperating state of the printer PR is the G/O state, the WFDNW has beenformed. The CPU 32 executes the WCS Exchange and the 4-Way Handshakewith the terminal apparatus TA. A process of executing the WCS Exchangeand the 4-Way Handshake is similar to the process described in S116 ofFIG. 3. When S256 is finished, the second monitoring process isfinished.

Specific Cases FIG. 6 to FIG. 9

Next, with reference to FIG. 6 to FIG. 9, content of specific cases A toD achieved in accordance with flow charts in FIG. 2 to FIG. 5 isdescribed. In any of the cases A to D, the terminal apparatus TA is aWFD apparatus and is in the device state. In any of the cases A to D,although an illustration is omitted, a specific apparatus having adevice name “CCC” exists around the terminal apparatus TA.

Case A FIG. 6

In this case, the printer PR is a G/O apparatus, and forms the WFDNWhaving the SSID “XXX”. The number of connections of the printer PR isless than the upper limit number. In T2, the user performs a searchoperation in the terminal apparatus TA. In T4, the terminal apparatus TAsends the Probe Req. signal including the WFD information and the devicename “BBB” of the terminal apparatus TA.

The printer PR, when receiving the Probe Req. signal from the terminalapparatus TA (YES in S2 of FIG. 2), in T6, sends the Probe Res. signalincluding the SSID “XXX” to the terminal apparatus TA (S4).

The terminal apparatus TA receives the Probe Res. signal from theprinter PR and further receives the Probe Res. signal including thedevice name “CCC” of the specific apparatus from the specific apparatusexisting around the terminal apparatus TA. In this case, in T8, theterminal apparatus TA displays a selection display 300 including theSSID “XXX” and the device name “CCC”.

In T10, the printer PR determines that the Probe Req. signal of T4includes the WFD information (YES in S10). Next, the printer PRdetermines that, in T12, field intensity of a carrier wave used incommunication of the Probe Req. signal is equal to or more than thethreshold Th (YES in S14), and in T14, displays the first inquiry image100 (refer to FIG. 2) (S16). In T16, the user selects the OK button 102(refer to FIG. 2) (OK in S102 of FIG. 3) in response to the firstinquiry image 100. In this case, in T18, the printer PR sends anInvitation Req. signal to the terminal apparatus TA (YES in S104, S106).

The terminal apparatus TA, when receiving the Invitation Req. signalfrom the printer PR, in T20, displays a third inquiry image 400. Thethird inquiry image 400 includes: a message for notifying the user thata connection request has been received from the apparatus having thedevice name “AAA” (namely, the printer PR); and a message for inquiringwith the user about whether to establish a connection between theprinter PR and the terminal apparatus TA. The third inquiry image 400includes an OK button 402 for selecting to establish a connection and aCancel button 404 for selecting not to establish a connection. In T22,the user selects the OK button 402 in response to the third inquiryimage 400. In this case, in T24, the terminal apparatus TA sends theInvitation Res. signal to the printer PR, and shifts to the CL state.

The printer PR, in a case of receiving the Invitation Res. signal fromthe terminal apparatus TA (S108), in T26, executes the first connectionsequence with the terminal apparatus TA, and establishes a connectionwith the terminal apparatus TA (S116). Because of this, the printer PRcan allow the terminal apparatus TA to participate as a CL apparatus inthe WFDNW in which the printer PR operates as a G/O apparatus. In thisway, in a state where the printer PR and the terminal apparatus TAbelong to a same WFDNW, the printer PR by using the WFDNW, for example,receives an image file from the terminal apparatus TA, and performsprinting of an image represented by the image file.

As described above, the printer PR, when the Probe Req. signal isreceived from the terminal apparatus TA (T4), displays the first inquiryimage 100 (refer to FIG. 2) for inquiring with the user about whether toestablish a connection between the printer PR and the terminal apparatusTA (T14). The printer PR, in a case where the OK button 102 (refer toFIG. 2) is selected by the user in response to the first inquiry image100 (T16), establishes a connection between the printer PR and theterminal apparatus TA (T18, T24, T26).

Supposing, in T14, a configuration in which the printer PR does notdisplay the first inquiry image 100 is adopted, the user is required toselect the SSID “XXX” in the selection display 300 displayed in T8 forestablishing a connection between the printer PR and the terminalapparatus TA. However, a user who lacks knowledge about the wirelesscommunication finds it difficult to select the SSID “XXX” in theselection display 300 and may possibly select the device name “CCC” bymistake. Namely, it is difficult for the user to establish a connectionbetween the printer PR and the terminal apparatus TA. On the contrary,in the present embodiment, the user is just required to select the OKbutton 102 in the first inquiry image 100 for establishing a connectionbetween the printer PR and the terminal apparatus TA and to select theOK button 402 in the third inquiry image 400. Namely, since the user isnot required to select the SSID “XXX” in the selection display 300, theuser can easily establish a connection between the printer PR and theterminal apparatus TA. Especially, in the case A, the user can easilyestablish a connection between the printer PR, which is a G/O apparatus,and the terminal apparatus TA.

Case B FIG. 7

In this case, the printer PR is a device apparatus. T102, T104 aresimilar to T2, T4 of FIG. 6. The printer PR, in a case of receiving theProbe Req. signal from the terminal apparatus TA (YES in S2 of FIG. 2),in T106, sends the Probe Res. signal including the device name “AAA” ofthe printer PR to the terminal apparatus TA (S8).

In T108, the terminal apparatus TA displays the selection display 310including the device name “AAA” and the device name “CCC”.

T110 to T116 are similar to T10 to T16 of FIG. 6. In T118, the printerPR sends the G/O Nego. Req. signal to the terminal apparatus TA (NO inS104, S112).

T120, T122 are similar to T20, 22 of FIG. 6. In T124, the terminalapparatus TA sends the G/O Nego. Res. signal to the printer PR.

The printer PR, when receiving the G/O Nego. Res. signal from theterminal apparatus TA (S114), in T125, sends the G/O Nego. Confirmationsignal to the terminal apparatus TA (S115). In this case, since the G/Opriority of the printer PR is higher than the G/O priority of theterminal apparatus TA, namely, the Intent value of the printer PR ishigher than the Intent value of the terminal apparatus TA, the printerPR shifts to the G/O state and the terminal apparatus TA shifts to theCL state.

In T128, the printer PR performs the first connection sequence with theterminal apparatus TA, and establishes a connection with the terminalapparatus TA (S116). Thereby, the printer PR can allow the terminalapparatus TA to participate as a CL apparatus in the WFDNW in which theprinter PR operates as a G/O apparatus.

In the case B also, similarly as in the case A of FIG. 6, compared to aconfiguration of a comparison example, the user can easily establish aconnection between the printer PR and the terminal apparatus TA.Particularly, in the case B, the user may easily establish a connectionbetween the printer PR which is a device apparatus and the terminalapparatus TA.

Case C FIG. 8

In this case, the printer PR is a G/O apparatus and forms the WFDNWhaving the SSID “XXX”. The number of connections of the printer PR isless than the upper limit number. T202 to T214 are similar to T2 to T14of FIG. 6. The user does not select the OK button 102 in the firstinquiry image 100 displayed in the printer PR in T214. In T216, the userselects the SSID “XXX” on the selection display 300 displayed in theterminal apparatus TA. In this case, in T218, the terminal apparatus TAsends the Provision Discovery Req. signal to the printer PR.

The printer PR, in a case of receiving the Provision Discovery Req.signal from the terminal apparatus TA (YES in S202 of FIG. 4), in T220,displays the second inquiry image 200 in place of the first inquiryimage 100 (S204). In T222, the user selects the OK button 202 inresponse to the second inquiry image 200 (OK in S206). In this case, inT226, the printer PR establishes a connection with the terminalapparatus TA by performing a second connection sequence with theterminal apparatus TA (S208). In the second connection sequence, bycommunication of the Provision Discovery Res. signal being performed,the terminal apparatus TA shifts to the CL state. Thereby, the printerPR can allow the terminal apparatus TA to participate as a CL apparatusin the WFDNW in which the printer PR operates as a G/O apparatus.

As described above, the printer PR, in a case where the OK button 102 isnot selected by the user in response to the first inquiry image 100 andthe Provision Discovery Req. signal is received from the terminalapparatus TA (T218), displays the second inquiry image 200 (T220). Next,the printer PR, when the OK button 202 is selected by the user inresponse to the second inquiry image 200 (T222), establishes aconnection with the terminal apparatus TA (T226). Consequently, theprinter PR, even when the OK button 102 is not selected by the user inresponse to the first inquiry image 100, can appropriately establish aconnection with the terminal apparatus TA.

Case D FIG. 9

In this case, the printer PR is a device apparatus. T302 to T314 aresimilar to T102 to T114 of FIG. 7. The user does not select the OKbutton 102 in the first inquiry image 100 displayed in the printer PR inT314. In T316, the user selects the device name “AAA” on the selectiondisplay 310 displayed in the terminal apparatus TA. In this case, inT318, the terminal apparatus TA sends the G/O Nego. Req. signal to theprinter PR.

T320, T322 are similar to T220, T222 of FIG. 8. In T324, the printer PRexecutes a third connection sequence with the terminal apparatus TA, andestablishes a connection with the terminal apparatus TA (S216 of FIG.4). In the third connection sequence, by communication between the G/ONego. Res. signal and the G/O Nego. Confirmation signal being performed,the printer PR shifts to the G/O state and the terminal apparatus TAshifts to the CL state. Thereby, the printer PR can allow the terminalapparatus TA to participate as a CL apparatus in the WFDNW in which theprinter PR operates as a G/O apparatus.

As described above, the printer PR, in a case where the OK button 102 isnot selected by the user in response to the first inquiry image 100 andthe G/O Nego. Req. signal is received (T318), displays the secondinquiry image 200 (T320). Next, the printer PR, in a case where the OKbutton 202 is selected by the user in response to the second inquiryimage 200 (T322), establishes a connection with the terminal apparatusTA (T324). The printer PR, even in a case where the OK button 102 is notselected by the user in response to the first inquiry image 100, canappropriately establish a connection with the terminal apparatus TA.

(Correspondence Relationship)

The printer PR and the terminal apparatus TA are examples of“communication apparatus” and “external apparatus”, respectively. A G/Oapparatus and a CL apparatus are examples of “parent station” and “childstation” respectively. The device state is one example of “state wherethe communication apparatus does not operate as either the parentstation or the child station of a wireless network”. The Probe Req.signal received in S2 of FIG. 2 is one example of “apparatus searchsignal”. The Invitation Req. signal is one example of “invitationsignal”. The Provision Discovery Req. signal received in S202 of FIG. 4and the G/O Nego. Req. signal received in S210 are examples of“connection request signal different from the apparatus search signal”.

A WFDNW that was formed in a case of YES in S104 of FIG. 3 is oneexample of “first wireless network”. A WFDNW, formed in S112 to S115, inwhich the printer PR operates as a G/O apparatus, is one example of“second wireless network”. A WFDNW, formed in S112 to S115, in which theterminal apparatus TA operates as a G/O apparatus is one example of“third wireless network”. A WFDNW, formed in S216 of FIG. 4, in whichthe printer PR operates as a G/O apparatus, is one example of “fifthwireless network”. A WFDNW, formed in S216, in which the terminalapparatus TA operates as a G/O apparatus, is one example of “sixthwireless network”. A WFDNW that was formed in a case of YES in S232 ofFIG. 5 is one example of “seventh wireless network”. A message includedin the first inquiry image 100 and a message included in the secondinquiry image 200 are examples of “first inquiry message” and “secondinquiry message”, respectively. The WFD scheme, the WFD information, thethreshold Th are examples of “predetermined wireless communicationscheme”, “support information”, and “predetermined value”, respectively.The SSID “XXX” and the device name “AAA” are examples of “identificationinformation”.

A process of S16 of FIG. 2 is one example of “causing the display todisplay a first inquiry message”. Processes of S106 to S116 of FIG. 3are examples of “establishing the particular wireless connection inresponse to the first inquiry message”. Processes of S204, S212 of FIG.4 are examples of “causing the display to display a second inquirymessage”. Processes of S208, S216 are examples of “establishing theparticular wireless connection in response to the second inquirymessage”.

Second Embodiment

As illustrated in FIG. 1, in the present embodiment, the memory 34 ofthe printer PR may further store a piece of Persistent information 38.The Persistent information 38 is information concerning connectionsestablished by the printer PR in the past, namely, informationconcerning a connection history of the printer PR. For instance, in acase where a connection between the printer PR and the terminalapparatus TA which is a WFD apparatus had been established in the past,namely, the printer PR and the terminal apparatus TA had belonged to asame WFDNW in the past, the Persistent information 38 includes the MACaddress “bbb” of the terminal apparatus TA, a SSID “YYY” of the aboveWFDNW, a password “ppp” of the above WFDNW, and status information. Thestatus information is information indicating whether the printer PR wasin the G/O state or in the CL state in the WFDNW. Although anillustration is omitted, the terminal apparatus TA may store thePersistent information. Status information included in the Persistentinformation is information indicating whether the terminal apparatus TAwas in the G/O state or in the CL state in the above WFDNW.

(First Monitoring Process)

In the present embodiment, in place of the first monitoring process ofFIG. 3, a first monitoring process of FIG. 10 is executed. S302 to S308are similar to S102 to S108 of FIG. 3.

In S310, the CPU 32 determines whether a connection history with theterminal apparatus TA exists. Particularly, the CPU 32 determineswhether a connection history indicating that the terminal apparatus TAhad participated in the past as a CL apparatus in a WFDNW (hereinafterreferred to as “current WFDNW”) currently formed by the printer PRexists. Specifically, the CPU 32 first specifies the MAC address “bbb”of the terminal apparatus TA included in the Probe Req. signal receivedfrom the terminal apparatus TA of S2 of FIG. 2. In a case where thePersistent information 38 (hereinafter referred to as “specificPersistent information”) including the specified MAC address “bbb” isstored in the memory 34, and the SSID “YYY” included in the specificPersistent information is identical to the SSID of the current WFDNW,the CPU 32 determines YES in S310, and proceeds to S312. On the otherhand, in a case where the specific Persistent information is not storedin the memory 34, or, in a case where the specific Persistentinformation is stored in the memory 34 but the SSID “YYY” included inthe specific Persistent information is not identical to the SSID of thecurrent WFDNW, the CPU 32 determines NO in S310, and proceeds to S314.S314 is similar to S116 of FIG. 3. When S314 is finished, the firstmonitoring process is finished.

In S312, the CPU 32 executes a fourth connection sequence with theterminal apparatus TA, and establishes a connection with the terminalapparatus TA. Specifically, the CPU 32 does not execute the WCSExchange, namely, does not send the password and such of the currentWFDNW to the terminal apparatus TA, and executes the 4-Way Handshakewith the terminal apparatus TA. The reason why the CPU 32 does not sendthe password and such of the current WFDNW to the terminal apparatus TAis as follows. Namely, the terminal apparatus TA had belonged to thecurrent WFDNW as a CL apparatus in the past, and stores the Persistentinformation including the password and such of the current WFDNW.Therefore, the terminal apparatus TA can establish a connection with theprinter PR even without obtaining the password and such of the currentWFDNW from the printer PR. Consequently, since the WCS Exchange is notexecuted, a connection between the printer PR and the terminal apparatusTA is rapidly established, and further, the communication load betweenthe printer PR and the terminal apparatus TA is reduced. When S312 isfinished, the first monitoring process is finished.

In a case where the printer PR is a device apparatus, in S316, the CPU32 determines whether a connection history with the terminal apparatusTA exists. The CPU 32 specifies the MAC address “bbb” of the terminalapparatus TA, and, in a case where the specific Persistent informationincluding the specified MAC address “bbb” is stored in the memory 34,determines YES in S316, and proceeds to S318, and, in a case where thespecific Persistent information 38 is not stored in the memory 34,determines NO in S316, and proceeds to S326. S326 to S330 are similar toS112 to S116 of FIG. 3. When S330 is finished, the first monitoringprocess is finished.

S318, S319 are similar to S306, S308. In S320, the CPU 32 shifts theoperating state of the printer PR from the device state to the G/O stateor the CL state in accordance with the status information included inthe specific Persistent information. Specifically, in a first case wherethe status information indicates the G/O state, the CPU 32 shifts theoperating state of the printer PR from the device state to the G/Ostate, and forms the WFDNW in which the printer PR operates as a G/Oapparatus. The first case is a case where the printer PR belongs to theWFDNW to which the printer PR and the terminal apparatus TA had belongedas G/O apparatuses in the past, and the terminal apparatus TA belongedto the WFDNW as a CL apparatus. In the first case, the terminalapparatus TA shifts the operating state of the terminal apparatus TAfrom the device state to the CL state. On the other hand, in a secondcase where the status information indicates the CL state, the CPU 32shifts the operating state of the printer PR from the device state tothe CL state. In the second case, the terminal apparatus TA shifts theoperating state of the terminal apparatus TA from the device state tothe G/O state, and forms the WFDNW in which the terminal apparatus TAoperates as a G/O apparatus. In the first and second cases, the WFDNWformed in S320 is the same WFDNW as the WFDNW to which the printer PRand the terminal apparatus TA had belonged in the past. In the first andsecond cases, the CPU 32 uses the password “ppp” included in thespecific Persistent information as a password of a WFDNW (hereinafterreferred to as “new WFDNW”) to be newly formed, and uses a SSID “YYY”included in the specific Persistent information as a SSID of the newWFDNW. The CPU 32 uses an authentication method included in the specificPersistent information as an authentication scheme of the new WFDNW, anduses an encryption scheme included in the specific Persistentinformation as an encryption scheme of the new WFDNW.

S324 is similar to S312. Namely, since the printer PR and the terminalapparatus TA store the Persistent information including the password andsuch of the new WFDNW, a connection can be established even withoutexecuting communication of the password and such. Therefore, aconnection between the printer PR and the terminal apparatus TA israpidly established, and moreover communication load between the printerPR and the terminal apparatus TA is reduced. When S324 is finished, thefirst monitoring process is finished.

Specific Case FIG. 11, FIG. 12

Next, with reference to FIG. 11 and FIG. 12, content of specific casesE, F achieved in accordance with flow charts in FIG. 2, FIG. 4, FIG. 5,and FIG. 10 is described. In either of the cases E, F, the terminalapparatus TA is a WFD apparatus and in the device state. In either ofthe cases E, F, although an illustration is omitted, a specificapparatus having the device name “CCC” exists around the terminalapparatus TA.

Case E FIG. 11

In this case, the printer PR is a G/O apparatus and forms the WFDNWhaving the SSID “XXX”. The printer PR stores the Persistent information38. The status information included in the Persistent information 38indicates that the printer PR was in the G/O state. The number ofconnections of the printer PR is less than the upper limit number. T402to T424 are similar to T2 to T24 of FIG. 6.

The printer PR, since the connection history with the terminal apparatusTA exists (YES in S310 of FIG. 10), in T426, executes the fourthconnection sequence with the terminal apparatus TA (S312).

As described above, the printer PR, since the connection history withthe terminal apparatus TA exists, executes the fourth connectionsequence not including the WSC Exchange with the terminal apparatus TA(T426). Since the WCS Exchange is not executed, the connection betweenthe printer PR and the terminal apparatus TA is rapidly established, andmoreover the communication load between the printer PR and the terminalapparatus TA is reduced.

Case F FIG. 12

In this case, the printer PR is a device apparatus, and stores thePersistent information 38. Status information included in the Persistentinformation 38 indicates that the printer PR is in the G/O state. T502to T516 are similar to T102 to T116 of FIG. 7.

The printer PR, since the connection history with the terminal apparatusTA exists (YES in S316 of FIG. 10), in T518, sends the Invitation Req.signal to the terminal apparatus TA (S318). T520 to T524 are similar toT420 to T424 of FIG. 11. The printer PR, in a case of receiving theInvitation Res. signal from the terminal apparatus TA (S319), shifts tothe G/O state (S320). The terminal apparatus TA shifts to the CL state.T526 is similar to T426 of FIG. 11.

In this case also, similarly to the case E of FIG. 11, since the WCSExchange is not executed, a connection between the printer PR and theterminal apparatus TA is rapidly established, moreover, thecommunication load between the printer PR and the terminal apparatus TAis reduced.

(Correspondence Relationship)

The Invitation Req. signal is one example of “particular signal”. Thenew WFDNW in a case of YES in S316 of FIG. 10 is one example of “fourthwireless network”. The processes of S306, S308, S312, S314, and S318 toS330 are examples of “establishing the particular wireless connection inresponse to the first inquiry message”. The process of S310, the processof S316, and the process to form the new WFDNW in S320 are “determiningwhether the external apparatus has previously belonged to the firstwireless network as the child station”, “determining whether theexternal apparatus has previously belonged as a child station or aparent station to a fourth wireless network”, and “reforming”,respectively.

(Modification 1) In each embodiment described above, although theprinter PR is a WFD apparatus, in a modification, the printer PR may notbe a WFD apparatus. The CPU 32 of the printer PR, when a power supply ofthe printer PR is turned ON, activates so-called a SoftAP, and mayoperate the printer PR as a pseudo AP. In this modification, in a casewhere the Probe Req. signal is received from the terminal apparatus TA(YES in S2 of FIG. 2), the CPU 32 may display the first inquiry image100 on the display unit 14 (S16). In a case where the OK button 102 inthe first inquiry image 100 is selected (OK in S102 of FIG. 3), the CPU32 may establish a connection with the terminal apparatus TA. Namely,the CPU 32 can allow the terminal apparatus TA to participate as a CLapparatus in the network in which the printer PR operates as a pseudoAP. Namely, in this modification, a SoftAP is one example of a “parentstation”.

(Modification 2) In each embodiment described above, although the CPU 32of the printer PR determines whether the Probe Req. signal received inS2 of FIG. 2 includes the WFD information (S10), in a modified example,the CPU 32 may not necessarily determine it. Namely, the CPU 32 may skipS10 and proceed to S14.

(Modification 3) In each embodiment described above, although the CPU 32of the printer PR determines whether field intensity of a carrier waveused in the communication of the Probe Req. signal received in S2 ofFIG. 2 is equal to or more than the threshold Th (S14), in amodification, the CPU 32 may not determine it. Namely, the CPU 32 mayskip S14 and proceed to S16. In a modification made by combining themodifications 2 and 3, the CPU 32 may not necessarily perform the secondmonitoring process of S20.

(Modification 4) In each embodiment described above, “communicationapparatus” is not limited to the printer PR capable of performing aprinting function, may be a scanner capable of performing a scanningfunction. The “communication apparatus” may be an apparatus such as aPC, a server, a portable terminal (a mobile phone, a smart phone, a PDA.and such) that performs functions different from the printing functionand the scanning function such as an image display function and a datacalculation function. Namely, “communication apparatus” includes alldevices with which a wireless connection may be established.

(Modification 5) In each embodiment described above, by the CPU 32 ofthe printer PR performing a program (namely, software), each kind of theprocesses of FIG. 2 to FIG. 5, and FIG. 10 is achieved. In place ofthis, at least one process among the processes of FIG. 2 to FIG. 5, andFIG. 10 may be achieved by hardware such as a logic circuit.

What is claimed is:
 1. A communication apparatus comprising: a display;a processor; and a memory storing computer-readable instructionstherein, the computer-readable instructions, when executed by theprocessor, causing the communication apparatus to perform: causing thedisplay to display a first inquiry message in a case where an apparatussearch signal is received from an external apparatus, the apparatussearch signal being for searching a target apparatus which is toestablish a wireless connection with the external apparatus, and thefirst inquiry message being for inquiring a user whether a particularwireless connection is to be established between the communicationapparatus and the external apparatus; and establishing the particularwireless connection between the communication apparatus and the externalapparatus in a case where it is selected by the user, in response to thefirst inquiry message, that the particular wireless connection is to beestablished.
 2. The communication apparatus as in claim 1, wherein in acase where it is selected by the user, in response to the first inquirymessage, that the particular wireless connection is to be established,under a state where a first wireless network in which the communicationapparatus operates as a parent station has been formed, the establishingin response to the first inquiry message includes establishing theparticular wireless connection by sending, to the external apparatus, aninvitation signal for inviting the external apparatus as a child stationin the first wireless network.
 3. The communication apparatus as inclaim 2, wherein the computer-readable instructions, when executed bythe processor, cause the communication apparatus to further perform:determining whether the external apparatus has previously belonged tothe first wireless network as the child station, in the case where it isselected by the user, in response to the first inquiry message, that theparticular wireless connection is to be established, under the statewhere the first wireless network has been formed, and the establishingthe particular wireless connection in response to the first inquirymessage includes: establishing the particular wireless connection bysending, to the external apparatus, a password being used in the firstwireless network, in a case where it is determined that the externalapparatus has never belonged to the first wireless network as the childstation; and establishing the particular wireless connection withoutsending the password to the external apparatus, in a case where it isdetermined that the external apparatus had previously belonged to thefirst wireless network as the child station.
 4. The communicationapparatus as in claim 1, wherein the first inquiry message is displayed,in a case where the apparatus search signal is received from theexternal apparatus, under a state where a first wireless network inwhich the communication apparatus operates as a parent station has beenformed, and where a number of wireless connections currently establishedby the communication apparatus is less than an upper limit number, thefirst inquiry message is not displayed, in a case where the apparatussearch signal is received from the external apparatus under the statewhere the first wireless network has been formed and where the number ofwireless connections currently established by the communicationapparatus is equal to the upper limit number.
 5. The communicationapparatus as in claim 1, wherein the establishing the particularwireless connection in response to the first inquiry message includes:executing an operation-determining communication for determining whetherthe communication apparatus is to operate as a parent station or a childstation, in a case where it is selected by the user, in response to thefirst inquiry message, that the particular wireless connection is to beestablished, under a state where the communication apparatus does notoperate as either the parent station or the child station of a wirelessnetwork; in a case where it is determined, in response to a result ofthe operation-determining communication, that the communicationapparatus is to operate as the parent station, establishing theparticular wireless connection so as to cause the external apparatus tobelong as a child station to a second wireless network in which thecommunication apparatus operates as a parent station; and in a casewhere it is determined, in response to the result of theoperation-determining communication, that the communication apparatus isto operate as the child station, establishing the particular wirelessconnection so as to cause the communication apparatus to belong as achild station to a third wireless network in which the externalapparatus operates as a parent station.
 6. The communication apparatusas in claim 5, wherein the computer-readable instructions, when executedby the processor, cause the communication apparatus to further perform:determining whether the external apparatus has previously belonged as achild station or a parent station to a fourth wireless network in whichthe communication apparatus operates as the parent station or the childstation, in the case where it is selected by the user, in response tothe first inquiry message, that the particular wireless connection is tobe established, under the state where the communication apparatus doesnot operate as either the parent station or the child station of thewireless network; and reforming the fourth wireless network in which thecommunication apparatus operates as the parent station, in a case whereit is determined that the external apparatus had previously belonged tothe fourth wireless network as the child station, wherein theestablishing the particular wireless connection in response to the firstinquiry message includes: establishing the particular wirelessconnection by sending, to the external apparatus, a particular signalfor requiring that both the communication apparatus and the externalapparatus belong to the fourth wireless network which is to be reformedby the communication apparatus, in a case where it is determined thatthe external apparatus had belonged to the fourth wireless network asthe child station, establishing the particular wireless connection bysending, to the external apparatus, a particular signal for requiringthat both the communication apparatus and the external apparatus belongto the fourth wireless network which is to be reformed by the externalapparatus, in a case where it is determined that the external apparatushad belonged to the fourth wireless network as the parent station, andestablishing the particular wireless connection by executing theoperation-determining communication, in a case where it is determinedthat the external apparatus has never belonged to the fourth wirelessnetwork as either the child station or the parent station.
 7. Thecommunication apparatus as in claim 1, wherein the first inquiry messageis displayed, in a case where the apparatus search signal is receivedfrom the external apparatus and the apparatus search signal includessupport information indicating that the external apparatus supports apredetermined wireless communication scheme, the first inquiry messageis not displayed, in a case where the apparatus search signal isreceived from the external apparatus and the apparatus search signaldoes not include the support information, and the predetermined wirelesscommunication scheme is a wireless communication scheme for establishinga wireless network in which one of the communication apparatus and theexternal apparatus operates as a parent station and the other operatesas a child station.
 8. The communication apparatus as in claim 1,wherein the first inquiry message is displayed, in a case where theapparatus search signal is received from the external apparatus and afield intensity of a carrier wave used in communicating the apparatussearch signal is equal to or more than a predetermined value, and thefirst inquiry message is not displayed, in a case where the apparatussearch signal is received from the external apparatus and the fieldintensity of the carrier wave is less than the predetermined value. 9.The communication apparatus as in claim 1, wherein the computer-readableinstructions, when executed by the processor, cause the communicationapparatus to further perform: causing the display to display a secondinquiry message different from the first inquiry message, in a casewhere it is not selected by the user, in response to the first inquirymessage, that the particular wireless connection is to be established,and a connection request signal different from the apparatus searchsignal is received from the external apparatus, the connection requestsignal being sent from the external apparatus to the communicationapparatus in a case where identification information for identifying thecommunication apparatus is selected by the user in the externalapparatus under a state where a selection screen including theidentification information is displayed in the external apparatus, thesecond inquiry message being for inquiring the user whether theparticular wireless connection is to be established in response to theconnection request signal; and establishing the particular wirelessconnection, in a case where it is selected by the user, in response tothe second inquiry message, that the particular wireless connection isto be established.
 10. The communication apparatus as in claim 9,wherein the establishing the particular wireless connection in responseto the second inquiry message includes: executing anoperation-determining communication for determining whether thecommunication apparatus is to operate as a parent station or a childstation, in a case where it is selected by the user, in response to thesecond inquiry message, that the particular wireless connection is to beestablished, under a state where the communication apparatus does notoperate as either the parent station or the child station of a wirelessnetwork; establishing the particular wireless connection so as to causethe external apparatus to belong as a child station to a fifth networkin which the communication apparatus operates as a parent station, in acase where it is determined that the communication apparatus is tooperate as the parent station in response to a result of theoperation-determining communication; and establishing the particularwireless connection so as to cause the communication apparatus to belongas a child station to a sixth network in which the external apparatusoperates as a parent station, in a case where it is determined that thecommunication apparatus is to operate as the child station in responseto the result of the operation-determining communication.
 11. Thecommunication apparatus as in claim 9, wherein the establishing theparticular wireless connection in response to the second inquiry messageincludes establishing the particular wireless connection so as to causethe external apparatus to belong as a child station to a seventhnetwork, in a case where it is selected by the user, in response to thesecond inquiry message, that the particular wireless connection is to beestablished, under a state where the seventh network in which thecommunication apparatus operates as a parent station has been formed.12. A non-transitory computer-readable storage medium storingcomputer-readable instructions for a communication apparatus, whereinthe computer-readable instructions, when executed by a processor of thecommunication apparatus, cause the communication apparatus to perform:causing a display of the communication apparatus to display a firstinquiry message in a case where an apparatus search signal is receivedfrom an external apparatus, the apparatus search signal being forsearching a target apparatus which is to establish a wireless connectionwith the external apparatus, and the first inquiry message being forinquiring a user whether a particular wireless connection is to beestablished between the communication apparatus and the externalapparatus; and establishing the particular wireless connection betweenthe communication apparatus and the external apparatus in a case whereit is selected by the user, in response to the first inquiry message,that the particular wireless connection is to be established.